package com.teach.service.impl;

import com.teach.entity.ArticleType;
import com.teach.mapper.ArticleTypeMapper;
import com.teach.service.ArticleTypeService;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <pre>
 * TODO : 文章类别业务逻辑实现类
 * 文章类别
 * ClassName : com.teach.service.impl.ArticleTypeServiceImpl
 * Author : J.L.Zhou
 * Tel : 15111047708
 * E-Mail : 12020042@qq.com
 * Date : 2020-10-31 19:59
 * Version : 1.0
 * </pre>
 */
@Service
public class ArticleTypeServiceImpl extends ServiceImpl<ArticleTypeMapper, ArticleType> implements ArticleTypeService {

	@Override
	public QueryWrapper<ArticleType> getQueryWrapper(ArticleType articleType) {
		QueryWrapper<ArticleType> queryWrapper = new QueryWrapper<ArticleType>();
		if(articleType.getArticleTypeId() != null) {
			queryWrapper.eq("ARTICLE_TYPE_ID", articleType.getArticleTypeId());
		}
		if(articleType.getArticleTypeName() != null) {
			queryWrapper.eq("ARTICLE_TYPE_NAME", articleType.getArticleTypeName());
		}
		if(articleType.getArticleTypeCode() != null) {
			queryWrapper.eq("ARTICLE_TYPE_CODE", articleType.getArticleTypeCode());
		}
		if(articleType.getArticleTypeParentId() != null) {
			queryWrapper.eq("ARTICLE_TYPE_PARENT_ID", articleType.getArticleTypeParentId());
		}
		return queryWrapper;
	}
	

}
